<div id="poll">
  <h3><img src="catalog/view/theme/<?php echo $template; ?>/image/pie.png" alt="" /><?php echo $heading_title; ?></h3>
  <div id="calculator_widget">
    <?php if ($poll_data) { ?>
      <h5><?php echo $poll_data['question']; ?></h5>
      <?php if (isset($answered) || isset($disabled)) { ?>
        <?php if (isset($reactions)) { ?>
          <table border="0px" width="100%" cellpadding="2">
            <?php for ($i = 0; $i < 8; $i++) { ?>
              <?php if (!empty($poll_data['answer_' . ($i + 1)])) { ?>
                <tr>
                	<td  width="30%"><?php echo $poll_data['answer_' . ($i + 1)]; ?></td>
                  	<td><div style="float:left;width:<?php echo 15+$percent[$i]; ?>px;height:15px;background-color:rgb(97,<?php echo $percent[$i]+180; ?>,97);margin-bottom:2px; "><?php echo $percent[$i]; ?>%</div></td>
                </tr>
              <?php } ?>
            <?php } ?>
            <tr>
              <td colspan="2" style="text-align: center;"><?php echo $text_total_votes . $total_votes; ?></td>
            </tr>
          </table>
          <div style="margin-top: 10px; text-align: center;"><a onclick="location='<?php echo $poll_results; ?>'"><?php echo $text_poll_results; ?></a></div>
        <?php } else { ?>
          <div style="text-align: center;"><?php echo $text_no_votes; ?></div>
        <?php } ?>
      <?php } else { ?>
        <form method="post" action="<?php echo $action; ?>" id="vote">
          <table border="0" width="100%">
            <?php for ($i = 0; $i < 8; $i++) { ?>
              <?php if (!empty($poll_data['answer_' . ($i + 1)])) { ?>
              <tr>
                <td width="12%"><input type="radio" name="poll_answer" value="<?php echo $i + 1; ?>" id="answer<?php echo $i + 1; ?>" /></td>
                <td style="font-size:15px;"><label for="answer<?php echo $i + 1; ?>"><?php echo $poll_data['answer_' . ($i + 1)]; ?></label></td>
              </tr>
              <?php } ?>
            <?php } ?>
            <input type="hidden" name="poll_id" value="<?php echo $poll_id; ?>" />
          </table>
          <div style="margin-top: 10px; text-align: center;"><a style="cursor: pointer;padding:8px 20px;" id="change" onclick="$('#vote').submit();" class="button"><?php echo $text_vote; ?></a></div>
        </form>
        <div style="margin-top: 10px; text-align: center;"><a style="cursor: pointer;padding:8px 20px;" onclick="location='<?php echo $poll_results; ?>'"><?php echo $text_poll_results; ?></a></div>
      <?php } ?>
    <?php } else { ?>
      <div style="text-align: center;"><?php echo $text_no_poll; ?></div>
    <?php } ?>
  </div>
  <div class="button">&nbsp;</div>
</div>
